﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;

namespace DataLayer
{
    [KnownType(typeof(Seat))]
    [KnownType(typeof(ScreenCast))]
    [DataContract(IsReference=true)]
    public class MovieHall
    {
        private int _number;
        private List<Seat> _seats;
        private List<ScreenCast> _screenCasts;

        public MovieHall(int number, List<Seat> seats)
        {
            SetValues(number, seats, null);
        }

        public MovieHall(int number)
        {
            SetValues(number, null, null);
        }

        private void SetValues(int number, List<Seat> seats, List<ScreenCast> screenCasts) {
            _number = number;
            _seats = seats;
            _screenCasts = screenCasts;
        }

        [DataMember]
        public int Number
        {
            get { return _number; }
            set { _number = value; }
        }

        [DataMember]
        public List<Seat> Seats
        {
            get { return _seats; }
            set { _seats = value; }
        }

        [DataMember]
        public List<ScreenCast> ScreenCasts
        {
            get { return _screenCasts; }
            set { _screenCasts = value; }
        }
    }
}
